package com.onec.service.customer.dao.agent;

import com.onec.service.api.dao.BaseRepository;
import com.onec.service.customer.entity.agent.AgentInfo;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.RepositoryDefinition;

/**
 * @author ONEC
 */
@RepositoryDefinition(domainClass = AgentInfo.class, idClass = Long.class)
public interface AgentInfoRepository extends BaseRepository<AgentInfo, Long> {

    /**
     * 查询代理信息通过Code
     *
     * @param agentCode
     * @return
     */
    AgentInfo findByAgentCode(String agentCode);

    @Modifying
    void deleteAgentInfoByAgentCode(String agentCode);
}
